#
# Makefile.in for libevhdns
# @configure_input@
# by pts@fazekas.hu at Sat Apr 24 21:17:36 CEST 2010
#

LIBS = @LIBS@
CC = @CC@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
CFLAGS = @CFLAGS@
LIBTOOL = @LIBTOOL@
SHELL = @SHELL@
top_builddir = @top_builddir@
INSTALL = @INSTALL@
DESTDIR =  # DESTDIR is overridden by Gentoo Emake

RELEASE = 1.4.13.4
SOURCES = evutil.c log.c evdns.c
HEADERS = config.h event-config.h evdns.h event-internal.h event.h evutil.h log.h

.PHONY: clean distclean install pruduct-and-version all

all: libevhdns.la

libevhdns.la: evhdns.lo
	$(LIBTOOL) --mode=link --tag=CC $(CC) -release $(RELEASE) -o libevhdns.la evhdns.lo -rpath $(libdir) $(LIBS)

evhdns.c:   $(SOURCES)
	cat $(SOURCES) >evhdns.c

event-config.h: config.h Makefile
	echo '/* event-config.h' > $@
	echo ' * Generated by autoconf; post-processed by libevent.' >> $@
	echo ' * Do not edit this file.' >> $@
	echo ' * Do not rely on macros in this file existing in later versions.'>> $@
	echo ' */' >> $@
	echo '#ifndef _EVENT_CONFIG_H_' >> $@
	echo '#define _EVENT_CONFIG_H_' >> $@

	sed -e 's/#define /#define _EVENT_/' \
	    -e 's/#undef /#undef _EVENT_/' \
	    -e 's/#ifndef /#ifndef _EVENT_/' < config.h >> $@
	echo "#endif" >> $@

evhdns.lo: evhdns.c $(HEADERS) Makefile
	$(LIBTOOL) --mode=compile --tag=CC $(CC) -I. -DHAVE_CONFIG_H $(CFLAGS) -c evhdns.c

install: libevhdns.la
	$(INSTALL) -d $(DESTDIR)$(libdir)
	$(LIBTOOL) --mode=install $(INSTALL) libevhdns.la $(DESTDIR)$(libdir)/libevhdns.la
	-ldconfig  # Linux-only. Does no harm elsewhere.

clean:
	rm -rf *.la *.lo *.o .libs evhdns.c

distclean: clean
	rm -f config.h Makefile test/Makefile sample/Makefile stamp-h1
	rm -f config.log config.status

product-and-version:
	@echo libevhdns-$(RELEASE)
